/*
 * > /*
>  * INSANE - Interactive Structural Analysis Environment
>  *
>  * Copyright (C) 2003-2004
>  * Universidade Federal de Minas Gerais
>  * Escola de Engenharia
>  * Departamento de Engenharia de Estruturas
>  *
>  * Author's email :     insane@dees.ufmg.br
>  * Author's Website :   http://www.dees.ufmg.br/insane
>  *
>  * This program is free software; you can redistribute it and/or
>  * modify it under the terms of the GNU General Public License
>  * as published by the Free Software Foundation; either version 2
>  * of the License, or any later version.
>  *
>  * This program is distributed in the hope that it will be useful,
>  * but WITHOUT ANY WARRANTY; without even the implied warranty of
>  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>  * GNU General Public License for more details.
>  *
>  * You should have received a copy of the GNU General Public License
>  * along with this program; if not, write to the Free Software
>  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-
> 1307, USA.
 *
 */

package br.ufmg.dees.insane.model.postp;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.ListIterator;

/**
 * This class represent the basics structures of this PostpModel.
 * The fields can be initiate by a points list and a defined Boudaries,
 * or a points list and the respectives Patches, or just a points list.
 * @author Samuel Silva Penna
 * @since 13/06/2006
 */
public class PostpModel implements Serializable{

	/**   */
	private static final long serialVersionUID = 1L;
	/** The label of this PostpModel  */
	private String label;
	/** The patches list of this PostpModel */
	private ArrayList<StepPostp> stepList;

	/** 
	 * The default constructor 
	 */
	public PostpModel() {
		this.stepList = new ArrayList<StepPostp>();
	}
	
	public void addStep(StepPostp step){
		this.stepList.add(step);
	}
	
	/**
	 * Remove a Step from the list
	 * @param label The label of the step to be removed
	 */
	public void getStep(String label){
		ListIterator i = this.stepList.listIterator();
		while(i.hasNext()){
			StepPostp s = (StepPostp)i.next();
			if(s.getLabel().equals(label)){
				this.stepList.remove(s);
			}
		}
	}
	
	/**
	 * Remove a Step from the list
	 * @param label The label of the step to be removed
	 */
	public void removeStep(String label){
		ListIterator i = this.stepList.listIterator();
		while(i.hasNext()){
			StepPostp s = (StepPostp)i.next();
			if(s.getLabel().equals(label)){
				this.stepList.remove(s);
			}
		}
	}
	
	/**
	 * The method return the label.
	 * @return Returns The label.
	 */
	public String getLabel() {
		return label;
	}

	/**
	 * The method set the field label from the parameter label.
	 * @param label The label to set.
	 */
	public void setLabel(String label) {
		this.label = label;
	}

	/**
	 * The method return the stepList.
	 * @return Returns The stepList.
	 */
	public ArrayList<StepPostp> getStepList() {
		return stepList;
	}

	/**
	 * The method set the field stepList from the parameter stepList.
	 * @param stepList The stepList to set.
	 */
	public void setStepList(ArrayList<StepPostp> stepList) {
		this.stepList = stepList;
	}
	
//***********************************************************************************	
}//end of this class
